
//localStorage 存储
export function setStorage(key: string, value: any) {
  localStorage.setItem(key, JSON.stringify(value));
}

//localStorage 读取
export function getStorage(key: string) {
    let value: any = localStorage.getItem(key);
    return JSON.parse(value);
}

//localStorage 删除
export function removeStorage(key: string) {
  localStorage.removeItem(key);
}

// localStorage 是否存在
export function hasStorage(key: string) {
  return localStorage.getItem(key) !== null;
}